package net.onecloud.onecloud.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zaizai on 16/7/27.
 */
public class ResultEnterprise implements Parcelable {


    private int code;
    private int success;
    private int more;
    private String message;
    private List<DataEntity> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getMore() {
        return more;
    }

    public void setMore(int more) {
        this.more = more;
    }

    public List<DataEntity> getData() {
        return data;
    }

    public void setData(List<DataEntity> data) {
        this.data = data;
    }

    public static class DataEntity implements Parcelable {

        private String id;
        private String ename;//名称
        private String address;//地址
        private String license; //执照
        private String etype;//类型
        private String phone; //联系电话
        private String email;//邮箱
        private String escale;//规模
        private String user_id;//外键

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getEname() {
            return ename;
        }

        public void setEname(String ename) {
            this.ename = ename;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getLicense() {
            return license;
        }

        public void setLicense(String license) {
            this.license = license;
        }

        public String getEtype() {
            return etype;
        }

        public void setEtype(String etype) {
            this.etype = etype;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getEmail() {
            return email;
        }

        public void setEmail(String email) {
            this.email = email;
        }

        public String getEscale() {
            return escale;
        }

        public void setEscale(String escale) {
            this.escale = escale;
        }

        public String getUser_id() {
            return user_id;
        }

        public void setUser_id(String user_id) {
            this.user_id = user_id;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.ename);
            dest.writeString(this.address);
            dest.writeString(this.license);
            dest.writeString(this.etype);
            dest.writeString(this.phone);
            dest.writeString(this.email);
            dest.writeString(this.escale);
            dest.writeString(this.user_id);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.id = in.readString();
            this.ename = in.readString();
            this.address = in.readString();
            this.license = in.readString();
            this.etype = in.readString();
            this.phone = in.readString();
            this.email = in.readString();
            this.escale = in.readString();
            this.user_id = in.readString();
        }

        public static final Creator<DataEntity> CREATOR = new Creator<DataEntity>() {
            @Override
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            @Override
            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.code);
        dest.writeInt(this.success);
        dest.writeString(this.message);
        dest.writeList(this.data);
        dest.writeInt(this.more);
    }

    public ResultEnterprise() {
    }

    protected ResultEnterprise(Parcel in) {
        this.code = in.readInt();
        this.success = in.readInt();
        this.more = in.readInt();
        this.message = in.readString();
        this.data = new ArrayList<DataEntity>();
        in.readList(this.data, DataEntity.class.getClassLoader());
    }

    public static final Creator<ResultEnterprise> CREATOR = new Creator<ResultEnterprise>() {
        @Override
        public ResultEnterprise createFromParcel(Parcel source) {
            return new ResultEnterprise(source);
        }

        @Override
        public ResultEnterprise[] newArray(int size) {
            return new ResultEnterprise[size];
        }
    };
}
